|Tools| |Up to Jolt: Converting bytecode to C | |The basic idea>

Jolt: Converting bytecode to C Jolt README


6.1 Jolt README

Here is a hackers-only version (which is my excuse to pander sloppy undocumented code :-) of a program to translate Java bytecode to C. Use at your own risk. It runs on Solaris only, and I have tried it only with gcc. The default install procedure assumes that gcc is available. You will also need the new JDK, where the compiler is packaged under the sun/* hierachy.

None of this code is copyrighted in any way. Feel free to reuse and rip apart and sell as you see fit. All I ask is that if you do use derived code, add me to the credit list.

INSTALL

The installation consists of editing INSTALL.sh to point to the root of the prebeta distribution, and running the script.

The install compiles the translator, translates the bytecode to C, compiles the C, and verifies the translator by translating the bytecode (again) to C using the compiled version of the translator.

The whole process takes a pretty long while, close to 20 minutes on my machine.

RUNNING

There is no documentation other than looking at the source code. If the install proceeds successfully, you are left with two versions of the translator -- one bytecoded and one self translated to native code. They are not much different in performance BTW, most of the time is spent in IO, which is not translated to C.

The first (bytecoded) version is in the same directory as the INSTALL.sh script. You use it by saying something like

java jolt.driver -bootstrap < path to class to be translated >
The -bootstrap option must be given when using the bytecoded version of the translator, it prevents the driver from trying to load a shared library.

The translator expects a subdirectory called jolt_ws to be present when run. C code and the new class is placed inside this directory.

The self translated version is generated as part of the verification process, and is present in a subdirectory called jolt_ws in the same directory as the INSTALL.sh script. You enter this directory, and run the translator by something like

java jolt.driver < path to class to be translated >
Same expectations as before. (It _is_ the same program :) The -bootstrap option should not be given.


|Tools| |Up to Jolt: Converting bytecode to C | |The basic idea>

KB Sriram
Comments, bug reports: kbs@sbktech.org

Revised: Sat May 25 10:13:04 1996
URL: http://www.sbktech.org/jolt-src.html